Hello,
I am currently facing a problematic with WireMock:
I have a specific request that I want to mock which should returns undefinitely a multipart/mixed Content-type.
Briefly, if I receive a GET /API/notification, the service I am trying to mock is returning every 0.5s a multipart/mixed the current time (+ a notification if something happens, but let's ignore that information for the moment).
I would like to simulate the same behaviour with wiremock and return every 0.5s the following message:
--boundary
Notification version="1.0"
dateTime1970-01-01T00
2929+01:00
/dateTime
/Notification
With the following header:
"Content-Type": "multipart/mixed; boundary=boundary"
I tried different solution like this:
{{#each (range 0 1200)}}--boundary\n
Notification version=\"1.0\"\n
dateTime{{now format=\"yyyy-MM-dd'T'HH
mmss\"}}
/dateTime\n
/Notification{{/each}}
But the {{now}} has the same value all along because it had been computed at the beginning.
Is there an other solution without having to create my own java helper?
Ps: here is my full json response:
"response": {
"status": 200,
"headers": {
"Content-Type": "multipart/mixed; boundary=boundary"
},
"body": "{{#each (range 0 1200)}}--boundary\n
Notification version=\"1.0\"\n
dateTime{{now format=\"yyyy-MM-dd'T'HH
mmss\"}}
/dateTime\n
/Notification{{/each}}",
"transformers": [
"response-template"
],
"chunkedDribbleDelay": {
"numberOfChunks": 1200,
"totalDuration": 1200000
}
}
Thanks for your feedback